import Cookie from '@/plugins/js-cookie'

const TokenKey = import.meta.env.VITE_CLIENT_ID

export function getToken(key: string = TokenKey): string {
  return Cookie.get(key) || ''
}

export function setToken(token: string) {
  const result = Cookie.set(TokenKey, token)
  return result
}

export function removeToken(key: string = TokenKey) {
  return Cookie.remove(key)
}
